package com.resoft.bigdata.p2p.job;

import java.util.List;

import com.resoft.bigdata.p2p.record.MonthlyStatistics;

public class JobListenerDemo implements StatisticJobListenner {

	@Override
	public void beginToStatistic(String beginDate, String endDate) {
		System.out.println("Begin to calculate [" + beginDate + "~" + endDate + "]");
		
	}

	@Override
	public void finishStatistic(String beginDate, String endDate,
			List<MonthlyStatistics> statistics) {
		System.out.println("calculate [" + beginDate + "~" + endDate + "] finished, p2p number:" + statistics.size());
		for(MonthlyStatistics ms:  statistics){
			System.out.println(ms);
		}
	}

	@Override
	public void failedStatistic(String p2pOrgCode, String beginDate,
			String endDate, String errorMsg) {
		System.err.println("calculate [" + beginDate + "~" + endDate + "] failed, p2p code:" + p2pOrgCode );
		System.err.println("Error message:" + errorMsg);
	}

	
}
